import cloneDeep from 'lodash/cloneDeep'

const initState = {
  // 热门分类
  hotCateData: [],
  // 分类列表
  // list: null
  list: {
    category: null,
    material: null
  }
}

export default (state = initState, { type, payload }) => {
  let newState = cloneDeep(state)
  // 更新热门分类
  if ('cate/hotCateData' == type) newState.hotCateData = payload
  // 更新分类列表
  if ('cate/setCategoryList' == type) newState.list = payload

  return newState
}
